/**
 * FileName：RCEnum
 * Version：
 * Date：2020/7/17
 * Copyright 马丁洛克 Corporation 2020 版权所有
 */
package com.sinux.generality.basesupport.utils.exception;

/**
 * @className BaseReturnEnum
 * @describe 系统默认的 返回code枚举 具体实现
 * {@link ReturnEnum}
 * @author panxw
 * @date 2020/7/17 11:29
 * @remark
 */
public enum BaseReturnEnum implements ReturnEnum {

    /** 注解 */
    OPERATE_SUCCESS(200, "执行成功"),
    PARA_ERROR(400, "参数错误"),
    SYSTEM_ERROR(500, "网络超时"),
    PARA_SIGN_ERROR(111, "签名异常"),
    PARA_TIME_ERROR(112, "时间戳误差较大"),
    TOKEN_AT_AGAIN(113, "Access-Token已过期,请附带Refresh-Token再次请求"),
    TOKEN_RT_EXPIRED(114, "登录已过期,请重新登录"),
    RBAC_ERROR(115, "权限缺失，请检查"),
    ACCESS_RATE_FAST(116, "请求频率过快"),
    USER_NOT_FOUND(117, "用户不存在"),
    USER_PASSWORD_ERROR(118, "用户密码错误")
    ;

    /**
     * 返回枚举code
     */
    private final Integer code;

    /**
     * 返回枚举msg
     */
    private final String msg;

    BaseReturnEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
